home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / utilities / misc / amigancp / docs / amigancp.doc < prev    next >
Encoding:
Text File  |  1995-03-13  |  58.5 KB  |  1,915 lines

  1.  
  2.  
  3. AmigaNCP
  4. ********
  5.  
  6. Welcome to the AmigaNCP package, the AmigaOS implementation of
  7. Psion's NCP network protocol.
  8.  
  9. Copyright
  10. *********
  11.  
  12. This is a limited demonstration copy of the AmigaNCP package.  You
  13. may test it for up to 30 days.  If you like it, fill in the order form
  14. and send it to
  15.  
  16.      B&B Computersysteme
  17.      c/o Michael Balzer
  18.      Winchenbachstraße 12h
  19.      42281 Wuppertal
  20.      Germany
  21.      
  22.      FAX: ++49-2332-13206
  23.  
  24. Payment may only be included cash or in form of a properly filled in
  25. euro cheque (with DM as currency).
  26.  
  27. In reply we will send you the full version and - if ordered - a printed
  28. manual.
  29.  
  30. The AmigaNCP package has been written by
  31.  
  32.      Oliver Wagner
  33.      o.wagner@pluribus.wupper.de
  34.      Winchenbachstraße 12h
  35.      42281 Wuppertal
  36.      Germany
  37.  
  38. ...who does this job for a living with his wife, four kids and two
  39. cats...
  40.  
  41. The AmigaNCP driver library, the AmigaNCP File Server, the AmigaNCP
  42. File System, the AmigaNCP Documentation and all associated files are
  43. copyright (C) 1993-1995 Oliver Wagner, All Rights Reserved.
  44.  
  45.     Psion, the Psion Logo, Psion Series 33-LinkPsion HC,
  46. Psion MCSSD and Solid State Disk are registered Trademarks of
  47. Psion PLC.
  48.  
  49.     Amiga, the Amiga logo and AmigaDOS are registered Trademarks of
  50. Commodore-Amiga, Inc.
  51.  
  52. The author wishes to thank the following people for their help during
  53. AmigaNCP development:
  54.  
  55. David Wood of Psion Ltd.
  56.      Who provided the necessary information about the NCP protocol and
  57.      helped with beta testing the package
  58.  
  59. Jeremy "Jezar" Wakefield of Psion Ltd.
  60.      Who helped to track down several hidden and esoteric bugs.
  61.  
  62. Michael Balzer
  63.      Who crossread and corrected this manual.
  64.  
  65. Sandro Paolini
  66.      For his overall help on AmigaNCP development and testing.
  67.  
  68. Eric (ed@ramses.fdn.org)
  69.      For providing the french catalog translation.
  70.  
  71. Phil Trickett (phil@dcs.king.ac.uk)
  72.      For the additional icon images.
  73.  
  74. Introduction
  75. ************
  76.  
  77. Overview
  78. ========
  79.  
  80. Psion's fine palmtop computer series, namely the S3 and S3a,
  81. contain an even finer operating system, whose neat features cover a full
  82. fledged peer-to-peer networking software using a protocol called
  83. NCP.
  84.  
  85. Using NCP, you can link together two Psion computers or a Psion and a
  86. different, perhaps stationary machine and happily exchange data on your
  87. behalf.  NCP services include, but are not limited to, accessing files
  88. on the remote machines as if they were on yours, in both directions.
  89.  
  90. Linking your palmtop to your stationary machine is generally quite a
  91. good idea.  Doing so via the NCP protocol requires your stationary
  92. machine to have an implemention of this protocol.  There have only been
  93. implementations for MS-DOS clones (the MCLINK.EXE shell), for Apple
  94. MacIntosh and for Acorn Archimedes - until now.
  95.  
  96. AmigaNCP features a full NCP implementation including a remote file
  97. server to access Amiga files from your Psion and a file system to access
  98. Psion files from your Amiga.  The package also offers an API to allow
  99. custom applications to directly access network services at the NCP
  100. level.
  101.  
  102. Parts of AmigaNCP
  103. =================
  104.  
  105. AmigaNCP actually consists of several different programs.
  106.  
  107. The main part is the amigancp.library.  It contains the basic network
  108. services for exchanging data between two machines via a serial
  109. connection.  The protocol provides up to 8 data channels, which can be
  110. either passive (awaiting a connection from a client process) or active
  111. (attempting to connect to a server process).  One of the channels is
  112. reserved for the network supervisor application LINK.  The LINK
  113. functionality also has been integrated into amigancp.library.
  114.  
  115. Besides network I/O functions, the library also provides several
  116. utility functions to deal with Psion text format and the Intel byte
  117. ordering.
  118.  
  119. The AmigaNCP-FileServer is an application built on top of
  120. amigancp.library.  It provides a means of accessing AmigaDOS
  121. files from the remote Psion computer via the REM:: file system.  This
  122. allows you to access Amiga files just as if they were local Psion
  123. files.  With the Psion S3a, it allows you to use the Backup option to
  124. backup vital data files on your Amiga's harddisk.
  125.  
  126. The AmigaNCP-FileSystem uses the amigancp.library to connect to
  127. the file server running on your Psion in order to provide access to
  128. Psion files from the AmigaDOS environment.  It provides a new AmigaDOS
  129. device named NCP: which offers access to all available Psion devices.
  130. The Psion devices will be mounted as subdirectories in the NCP:
  131. window.
  132.  
  133. The AmigaNCP-Monitor monitors the activity of the NCP supervisor and
  134. gives detailed statistics about all channels.  This is an invaluable
  135. aid for debugging NCP applications.
  136.  
  137. The S3PrintServer allows you to print from your S3 or S3a directly to
  138. a printer connected to the Amiga.
  139.  
  140. The S3Run program remotely launches programs or applications on your
  141. Psion.
  142.  
  143. Using AmigaNCP
  144. **************
  145.  
  146. Installation
  147. ============
  148.  
  149. For using AmigaNCP you'll need...
  150.  
  151.   1. any Amiga equipped with OS 2.04 or better and a free serial port
  152.  
  153.   2. the IBM-PC version of the 3-Link serial cable
  154.  
  155.   3. and a Psion S3 or S3a (or any other model featuring Remote
  156.      Link)(1).
  157.  
  158.  
  159. To support Amiga systems without a hard disk, the AmigaNCP distribution
  160. has been organized to be ready-to-use.
  161.  
  162. Hard disk installation of AmigaNCP is best done using the provided
  163. Installer script.  The script will (by default) copy
  164. amigancp.library to LIBS:, put the language catalogs into
  165. LOCALE:Catalogs/ and create an AmigaNCP drawer on your work
  166. partition.  The drawer will contain the network services, documentation
  167. and the NCP tools.  There's an additional option for installing the
  168. amigancp.library developer material.
  169.  
  170. When installing the package for the first time, the installation
  171. procedure will ask you about the Psion model you're going to connect
  172. to.  The serial line speed will be set to the model's maximum (that is
  173. 9600 baud for the S3 or HC and 19200 baud for S3a or MC).
  174.  
  175. Configuring amigancp.library
  176. ============================
  177.  
  178. The default serial configuration is to use the serial.device, unit 0,
  179. at 9600 baud(2).
  180.  
  181. You can overwrite these default parameters by setting or changing the
  182. environment variable NCP.config.  The environment variable will be
  183. read by the amigancp.library each time a serial connection has to be
  184. established.
  185.  
  186. The parameter parsing is done just like in a shell command line; the
  187. template is D=DEVICE/K, U=UNIT/K/N, B=BAUD/K/N, NOREQ/S.  All
  188. parameters are optional, those not given will retain their default
  189. values.
  190.  
  191. An example:  To make AmigaNCP use duart.device, unit 1 at 19200 baud
  192. you have to set ENV:NCP.config to
  193.  
  194.     DEVICE=duart.device UNIT=1 BAUD=19200
  195.  
  196. The installation script will create both ENV:NCP.config and
  197. ENVARC:NCP.config with either
  198.  
  199.     DEVICE=serial.device UNIT=0 BAUD=9600
  200.  
  201. or
  202.  
  203.     DEVICE=serial.device UNIT=0 BAUD=19200
  204.  
  205. depending on your choice of Psion model.  Please note, that you may
  206. actually use any baud rate supported by the serial port in question
  207. (and of course supported by the other side's serial interface as well).
  208.  
  209. If you set the NOREQ switch, the library will not display any error
  210. requesters.
  211.  
  212. Note that you have to configure the remote site as well.  On the Psion
  213. S3 or S3a this consists of turning on NCP via the Remote Link menu of
  214. the system screen.  The baud rate must of course be set to the same
  215. value as used in ENV:NCP.config, or to 9600 if no configuration file
  216. exists.
  217.  
  218. Starting AmigaNCP
  219. =================
  220.  
  221. You don't start amigancp.library directly.  Instead you start one or
  222. more of the AmigaNCP applications, which in turn will open the library
  223. and try to establish their connections to the remote NCP site.
  224.  
  225. The library automatically terminates a connection about 10 seconds
  226. after the last application has closed its network channels.
  227.  
  228. Note that the underlying serial device is free to be used by any other
  229. application as long as no NCP connection is active and no connection
  230. attempt is made.
  231.  
  232. NCP Requesters
  233. ==============
  234.  
  235. The amigancp.library will put up error requesters if the network link
  236. breaks (and the NOREQ switch hasn't been set, see above).  The
  237. following table shows possible error conditions:
  238.  
  239. Can't open serial device
  240.      The device specified in ENV:NCP.config could not be opened.
  241.      Either the device does not exist (perhaps just because you
  242.      misspelled the device name) or it is in use by another process.
  243.  
  244. Timeout waiting for response
  245.      The serial device opened ok but the other side is not responding
  246.      to our handshake packet.  Most likey there is no Psion connected,
  247.      or it has it's Remote Link turned off.  This requester will
  248.      constantly show up if the AmigaNCP file system is running and the
  249.      serial link broke down.
  250.  
  251. Data not acknowledged
  252.      The last data packet has not been acknowledged.  This normally
  253.      denotes an NCP connection which has been interrupted during data
  254.      transfer.
  255.  
  256. Connection dropped
  257.      The remote side dropped the connection.
  258.  
  259. Argument error
  260.      Bad LLMAC request arguments.  You normally should not see this
  261.      error, it denotes an internal failure in the amigancp.library
  262.      high level I/O functions.
  263.  
  264. Not connected
  265.      There is no LLMAC connection.  You normally should not see this
  266.      error, it denotes an internal failure in the amigancp.library
  267.      high level I/O functions.
  268.  
  269. ---------- Footnotes ----------
  270.  
  271. (1)  In fact of course any NCP implementation does.  You can use
  272. AmigaNCP to connect to an NCP server running on an IBM PC or Apple Mac,
  273. or even to another AmigaNCP running on a different Amiga.
  274.  
  275. (2)  All other serial flags are fixed to 8N1, highspeed mode and 7-wire
  276. RTS/CTS handshake since this is required by the NCP protocol.
  277.  
  278. AmigaNCP File Server
  279. ********************
  280.  
  281. Introducing the File Server
  282. ===========================
  283.  
  284. The AmigaNCP File Server is an NCP application which provides access
  285. to Amiga files from the remote machine.  On startup it creates a
  286. passive NCP channel awaiting a connection from a remote file system.
  287.  
  288. On the S3 and S3a, the remote file system is built into the ROM.  It
  289. automatically attempts to connect to the remote file server when an NCP
  290. connection is made, and presents a new filesystem node named REM::,
  291. which in turn contains all the Amiga devices.  You can navigate through
  292. the Amiga devices via the system screen or directly access a file by
  293. it's full path name.
  294.  
  295. The Psion's file system was designed to be device independant, so there
  296. are no restrictions concerning the length of file names or extensions:
  297. The complete Amiga device, directory and file names are fully
  298. preserved.  However, directories are separated in the standard Psion
  299. manner via the \ character.
  300.  
  301. An example:  To access the Amiga file HD1:Test/Test.txt from the
  302. Psion, use the file name REM::HD1:\\TEST\\TEST.TXT.  To access
  303. SYS:S/Startup-Sequence, use REM::\\SYS:\\STARTUP-SEQUENCE.
  304.  
  305. When asked for a device list, the AmigaNCP File Server will output only
  306. real file system devices(1).  However, you may in fact access any
  307. AmigaDOS device, even volumes and assigned names, from the remote site
  308. by using the direct path to it.
  309.  
  310. An example:  To access the Amiga's parallel port from the remote site,
  311. just use the path REM::PAR:\\.  This is quite useful for using the
  312. print-to-file capabilities of some of the Psion applications.
  313.  
  314. Character conversion mode
  315. =========================
  316.  
  317. Since the Psion's operating system uses a different character codeset
  318. than the Amiga does, you normally can't easily exchange ASCII files
  319. between the two machines.  The AmigaNCP File Server however provides a
  320. special conversion mode which allows to convert files on the fly.
  321.  
  322. Whenever you add the special extension .CV to any remote file name,
  323. all characters read from or written to that file will
  324. automatically be converted by AmigaNCP.  The conversion is fully
  325. transparent to your applications.
  326.  
  327. An example:  To edit the Amiga text file HD1:Test/Test.TXT on the S3
  328. with automatic character conversion, use the virtual file name
  329. REM::HD1:\\TEST\\TEST.TXT.CV.
  330.  
  331. Note that character conversion mode should be used only for text
  332. files.  The S3 and S3a Word file format for example contains binary
  333. data which will be gracefully mangled if accessed in conversion mode.
  334.  
  335. File Server Options
  336. ===================
  337.  
  338. The AmigaNCP File Server may be started either from the shell or from
  339. Workbench.  To terminate the server, just start it again, it will put
  340. up a requester showing you the number of files in use and asking you
  341. whether you really want to quit.
  342.  
  343. The File Server accepts several options to modify the way it operates.
  344. Note that you have to set up amigancp.library first (See Using
  345. AmigaNCP.).
  346.  
  347. Options may be given on the command line (shell) or using tooltype
  348. entries (Workbench).  You may use project icons to start the File
  349. Server in order to have different configurations at hand.
  350.  
  351. The option template is:
  352.          IBM=CHARSETCONV/S,
  353.      SHOWICONS=SHOWINFO/S,
  354.      HIDEEMPTYDRIVES/S,
  355.      BUFFER=BUFFERSIZE
  356. You may enter ? to get additional help at the command line.  Detailed
  357. parameter descriptions follow.
  358.  
  359. CharSetConv
  360. -----------
  361.  
  362. When the remote file system requests a directory scan, the file server
  363. examines each file to determine whether it is a text file or not(2).
  364. Text files are then returned both with their normal name and with the
  365. magic extension .CV added.
  366.  
  367. ShowInfo
  368. --------
  369.  
  370. Show *.info and .backdrop files during a directory scan.  You
  371. normally shouldn't set this option, the Psion has no use for these
  372. files and directory scans are much faster without them.
  373.  
  374. Please note that the Psion's Delete Whole Directory function will
  375. only work correctly on Amiga directories if ShowInfo has been enabled.
  376.  
  377. HideEmptyDrives
  378. ---------------
  379.  
  380. Upon a device list query, don't return drives which currently do not
  381. contain a medium.  This option is intended mainly to overcome an
  382. annoying quirk in the S3 and S3a system screen which resets the current
  383. device to LOC::\\M\\ each time a device reports E_NOT_READY.  This
  384. normally always happens when getting to REM::DF0: with no disk in the
  385. drive.
  386.  
  387. Note that, although these devices are not visible in the device list,
  388. they may as usual be accessed by manually entering the device name.
  389.  
  390. BufferSize
  391. ----------
  392.  
  393. Set the size of the filehandle buffers used by the File Server.  This
  394. parameter defaults to 4096 Bytes and normally doesn't need to be
  395. changed(3).
  396.  
  397. ---------- Footnotes ----------
  398.  
  399. (1)  Tech info:  Any device which responds positively to
  400. ACTION_IS_FILESYSTEM is considered to be a real file system.
  401.  
  402. (2)  Tech info:  This is done by reading the first 512 Bytes and
  403. scanning them for non-printable characters.  Files with the S
  404. protection bit set are always assumed to be text files.
  405.  
  406. (3)  This option has no effect on AmigaOS below version 3.1
  407.  
  408. AmigaNCP File System
  409. ********************
  410.  
  411. Introducing the File System
  412. ===========================
  413.  
  414. The AmigaNCP File System is an NCP application which provides access
  415. from the AmigaDOS environment to files on the remote machine.  It
  416. creates a new AmigaDOS device named NCP:, which in turn contains all
  417. remote devices as subdirectories.
  418.  
  419. The Amiga directory NCP:A refers to the device A: on the remote
  420. side, NCP:M refers to M: and so on.
  421.  
  422. If you want to access any file on the remote device, just add the full
  423. path name.  To access the file A:\\WRD\\SECRET.WRD, just use the
  424. Amiga file name NCP:A/WRD/SECRET.WRD.
  425.  
  426. You can access the new device from any Amiga application, including
  427. Workbench and your favourite directory tool, as if they were standard
  428. Amiga files.
  429.  
  430. On startup, the AmigaNCP File System immediately attempts to connect to
  431. the File Server on the remote machine.  If no connection can be made,
  432. the File System will refuse to start.  You may attempt to quit it at
  433. any time by starting it again, however, due to AmigaDOS constraints it
  434. will refuse to quit if there are any files or locks still in use.
  435.  
  436. Character Conversion Mode
  437. =========================
  438.  
  439. The AmigaNCP File System also features the character conversion mode.
  440. If you enable this option, all remote devices will be mirrored as
  441. CONV_<devname>, and all characters read from or written to files
  442. within these subdirectories will automatically be converted.
  443.  
  444. Example:  To access A:\\WRD\\SECRET.TXT with character conversion,
  445. use the file name NCP:CONV_A/WRD/SECRET.TXT.
  446.  
  447. The translation is fully transparent; you may, for example, use your
  448. favourite text editor to load a text file from the Psion, edit it and
  449. save it again.  Upon reading, it will be converted to the Amiga ISO
  450. character set, upon writing, it will be converted back to the IBM codes
  451. used by the Psion.
  452.  
  453. File System Options
  454. ===================
  455.  
  456. The File System accepts several options to modify the way it operates.
  457. Note that you have to set up amigancp.library first (See Using
  458. AmigaNCP.).
  459.  
  460. Upon shell startup, options are specified on the command line.  The
  461. template is:
  462.          VOL=VOLUMENAME/K,
  463.      DEV=DEVICENAME/K,
  464.      SR=SHAREDREAD/S,
  465.      IBM=CHARSETCONV/S,
  466.      HED=HIDEEMPTYDRIVES/S,
  467.      DWMS=DONTWARNMISSINGSERVER/S,
  468.      ARR=AUTOREREAD/S,
  469.      ID=ICONDIR/S
  470. You may enter ? to get additional help at the command line.  See
  471. below for detailed descriptions of these parameters.
  472.  
  473. If started from Workbench, the File System application will read its
  474. icon and parse the tooltypes for the same option keywords.  You may use
  475. project icons for starting the File System in order to have different
  476. configurations at hand.
  477.  
  478. VolumeName
  479. ----------
  480.  
  481. This options allows you to set the volume node name of the File System.
  482. Defaults to AmigaNCP-Remote.  This is the name the Workbench shows
  483. below the disk icon.
  484.  
  485. DeviceName
  486. ----------
  487.  
  488. Modifies the device name of the File System.  Defaults to NCP:.
  489.  
  490. SharedRead
  491. ----------
  492.  
  493. For historical reasons, there is no real read only mode in the
  494. AmigaDOS.  The access mode MODE_OLDFILE can be used for reading and
  495. writing an existing file from multiple accessors.  So an Amiga file
  496. system cannot predict whether a file opened with MODE_OLDFILE will
  497. also be written to.
  498.  
  499. The Psion filing system however limits multiple file access to read
  500. only mode.
  501.  
  502. To be as compatible as possible with existing Amiga applications, the
  503. AmigaNCP File System by default translates MODE_OLDFILE to exclusive
  504. read/write access on the Psion.
  505.  
  506. This may cause problems if a file is already opened for reading from
  507. the Psion side, perhaps because you have a Psion application running
  508. which accesses this file.  Even a read only access from the Amiga side
  509. will fail because it translates to a read/write access on the Psion
  510. side.
  511.  
  512. In order to overcome this AmigaDOS quirk, the AmigaNCP File System
  513. provides this option to translate MODE_OLDFILE to a shared read
  514. access on the Psion side.  Every write attempt on such a file will
  515. result in a ERROR_WRITE_PROTECTED.
  516.  
  517. CharSetConv
  518. -----------
  519.  
  520. Activate character conversion mode.  All Psion devices are mirrored as
  521. CONV_<devname and read/write accesses to files within these drawers
  522. are silently translated.
  523.  
  524. Note that file handles opened in character conversion mode don't
  525. support ACTION_SEEK.  This may cause problems with some applications.
  526.  
  527. HideEmptyDrives
  528. ---------------
  529.  
  530. Don't create subdirectories for Psion devices which don't contain a
  531. medium.
  532.  
  533. DontWarnMissingServer
  534. ---------------------
  535.  
  536. The File Server should normally be started first, because the Psion
  537. LINK application attempts to contact it as soon as the connection has
  538. been established, and it will not try again if no connection could be
  539. made.
  540.  
  541. Therefore, the File System will warn you with a requester if it can't
  542. detect the AmigaNCP File Server when it is started.  Setting this option
  543. instructs the File System not to do so.
  544.  
  545. AutoReRead
  546. ----------
  547.  
  548. By default, the File System reads the remote device list only once at
  549. the time it is started.
  550.  
  551. This should normally be no problem, unless you use HideEmptyDrives
  552. and replace SSD cartridges while a connection is active.
  553.  
  554. You can use DiskChange NCP: at any time to manually force the File
  555. System to read the device list again.  Or you can set AutoReRead,
  556. which causes the File System to read the device list from the remote
  557. side upon every access, which of course will slow accesses down a bit.
  558.  
  559. IconDir
  560. -------
  561.  
  562. In order to be compatible with the Workbench environment, the File
  563. System stores icon and workbench information files (.info and
  564. .backdrop) in a special file hierarchy on the AmigaDOS side.
  565. This allows you to do snapshoting and backdroping of icons belonging to
  566. Psion files without wasting valuable storage memory on the Psion.  This
  567. also avoids the problem that the Psion file system can't handle file
  568. extensions longer than three characters.
  569.  
  570. The default path for storing these files is the drawer Icons in the
  571. subdirectory where the File System program resides.  Using the
  572. IconDir option, you can specify another path.  This is quite
  573. useful if you use AmigaNCP to connect to different Psions with
  574. different file structures.
  575.  
  576. The file structure inside this IconDir drawer is organized exactly like
  577. in the NCP: device.  So, a icon file belonging to WRD drawer on the
  578. M device on the Psion is located in Icons/M/WRD.info.
  579.  
  580. Implementation Details
  581. ======================
  582.  
  583. The AmigaNCP File System supports the following AmigaDOS packet types:
  584.  
  585.    * ACTION_IS_FILESYSTEM
  586.  
  587.    * ACTION_FLUSH
  588.  
  589.    * ACTION_DISK_INFO
  590.      The resulting disk sizes are calculated by adding the per-device
  591.      sizes of the underlying Psion devices.
  592.  
  593.    * ACTION_INFO
  594.  
  595.    * ACTION_COPY_DIR
  596.  
  597.    * ACTION_COPY_DIR_FH
  598.  
  599.    * ACTION_LOCATE_OBJECT
  600.  
  601.    * ACTION_FREE_LOCK
  602.  
  603.    * ACTION_EXAMINE_FH
  604.  
  605.    * ACTION_EXAMINE_OBJECT
  606.  
  607.    * ACTION_EXAMINE_NEXT
  608.      Psion directory lists are read completly on the first EXNEXT
  609.      packet and kept in a private cache of the lock. This results in a
  610.      ExAll() like performance even with using the old style directory
  611.      scanning packets.
  612.  
  613.    * ACTION_CURRENT_VOLUME
  614.  
  615.    * ACTION_SAME_LOCK
  616.  
  617.    * ACTION_CREATE_DIR
  618.  
  619.    * ACTION_PARENT
  620.  
  621.    * ACTION_PARENT_FH
  622.  
  623.    * ACTION_DELETE_OBJECT
  624.  
  625.    * ACTION_RENAME_OBJECT
  626.      Note that renaming an non-icon file to an icon-file will yield
  627.      ERROR_RENAME_ACROSS_DEVICES.
  628.  
  629.    * ACTION_DIE
  630.  
  631.    * ACTION_FINDINPUT
  632.      See the description of the SharedRead option for differen
  633.      translation modes.
  634.  
  635.    * ACTION_FINDOUTPUT
  636.  
  637.    * ACTION_FINDUPDATE
  638.      This always translates to exclusive access on the Psion side.
  639.  
  640.    * ACTION_INHIBIT
  641.  
  642.    * ACTION_END
  643.  
  644.    * ACTION_READ
  645.  
  646.    * ACTION_WRITE
  647.  
  648.    * ACTION_SEEK
  649.      Not available on files opened in character conversion mode.
  650.  
  651.    * ACTION_SET_PROTECT
  652.      Supports FIBF__ARCHIVEFIBF_READFIBF_WRITE  and
  653.      FIBF_EXECUTE.
  654.  
  655.    * ACTION_SET_DATE
  656.  
  657. Other Tools
  658. ***********
  659.  
  660. The AmigaNCP package contains a few more programs which are meant for
  661. the advanced user.  Since they are also good examples for how to access
  662. the amigancp.library, the source code for most of these utilities can
  663. be found in the Developer/Source/ drawer.
  664.  
  665. AmigaNCP-Monitor
  666. ================
  667.  
  668. The AmigaNCP-Monitor is a utility for monitoring the current network
  669. activity.  It displays an overview over the eight avaible NCP channels,
  670. their users, current connection states and the amount of data that has
  671. been transferred.
  672.  
  673.     AmigaNCP-Monitor may be started either from the shell or from
  674. Workbench.  There are no additional parameters.  The window position
  675. will be saved as a tooltype entry.
  676.  
  677. The Monitor opens a single window on the workbench screen.  The top
  678. part displays the states of the eight network channels, the bottom part
  679. shows overall statistics and whether NCP is currently connected.
  680.  
  681. ThisProc
  682.      The network name of the Amiga process using the channel.  The
  683.      first channel is always allocated by the LINK application.
  684.  
  685. RemotePr
  686.      The name of the remote process.  This may be empty, meaning the
  687.      channel is currently not connected.
  688.  
  689.          UnknClnt identifies a passive channel connected to an
  690.      unknown client.
  691.  
  692.      For the first channel, this may be either ARemLink, denoting
  693.      that the current connection has been initiated by the remote link,
  694.      or PRemLink, if the current connection was opened on behalf of
  695.      the amigancp.library.
  696.  
  697. Status
  698.      This flag array denotes various internal states of
  699.      amigancp.library.
  700.  
  701. Bytes Sent
  702.      How many bytes have been sent through this channel?
  703.  
  704. Bytes Received
  705.      How many bytes have been received through this channel?
  706.  
  707. Online since
  708.      The time on which amigancp.library was started first.  The
  709.      startup time is used by the NCP protocol to determine whether a
  710.      broken connection can be reestablished or not.
  711.  
  712. Remote NCP
  713.      The remote NCP's startup time.
  714.  
  715. Version
  716.      The remote NCP's version.  This is generally 2 for AmigaNCP and
  717.      the Psion S3 and 3 for the S3a.
  718.  
  719. Connected
  720.      This will be displayed whenever there is an active connection to
  721.      any remote NCP.
  722.  
  723. S3PrintServer
  724. =============
  725.  
  726. The S3PrintServer is a small utility which allows you to print from
  727. your Psion directly to a printer connected to the Amiga.  It uses the
  728. Psion's capability to print to a serial printer, and simply passes any
  729. data from the serial port directly to the printer device via raw writes.
  730.  
  731. You have to turn off the Remote Link on the Psion side and terminate
  732. any NCP application running on the Amiga side before starting the
  733. S3PrintServer.  If you forget to turn off the Remote Link, junk will
  734. be printed due to misinterpreted NCP packets!
  735.  
  736. You must also set your Psion's printer configuration to serial
  737. printing, with the same baud rate used for NCP connections, turn off
  738. Xon/Xoff and turn on RTS/CTS and DSR/DTR handshaking.  The
  739. S3PrintServer itself reads the serial configuration from the file
  740. ENV:NCP.config.
  741.  
  742. The S3PrintServer uses the raw write capabilities of the
  743. printer.device and therefore ignores any printer driver settings.
  744. However, it respects your choice on which device to print, and even
  745. allows printing via network printer services, e.g.  Envoy Network
  746. Printing.
  747.  
  748. Therefore, you must select the correct WDR printer driver on the
  749. Psion.  This can be done in the Printer Setup dialog of the
  750. Word application.
  751.  
  752. Having done all this, you can print from your Psion applications simply
  753. by selecting the Print... menu, just as if the printer was connected
  754. directly to the Psion.
  755.  
  756. S3Run
  757. =====
  758.  
  759. The S3Run utility uses the LINK application's capability to launch
  760. a process on the remote side.  It's a shell only program which takes
  761. one or two parameters: S3Run filename commandline
  762.  
  763. The first argument denotes the file name of the remote program to run,
  764. for example TEST.IMG.  Due to NCP restrictions, this may only be a
  765. program on the Psion's top level directory or ROM.
  766.  
  767. The second argument may contain the command line to be passed to the
  768. created process.  This argument may be omitted, in which case no command
  769. line will be passed.
  770.  
  771. You may use \\xx escaping to insert the hexadecimal code xx into
  772. the command line.  See `the Psion SIBO SDK Manual' for more information
  773. on S3 command lines.
  774.  
  775. API
  776. ***
  777.  
  778. This part of the AmigaNCP documentation describes the use of AmigaNCP
  779. services within custom applications.  It assumes a broad knowledge of
  780. programming AmigaOS.
  781.  
  782. NCP Implementation
  783. ==================
  784.  
  785. The Psion NCP network protocol consists of four layers:
  786.  
  787. Serial Layer
  788.      A simple asynchronous serial 8/N/1 connection.  This is in fact
  789.      the hardware serial connection built into the 3-Link.
  790.  
  791. Packet Layer
  792.      A packet protocol providing checksums and multiple
  793.      retransmissions.  It is called LLMAC and somewhat based on the
  794.      MNP type protocols.
  795.  
  796. NCP Layer
  797.      NCP provides up to eight independant data streams between local
  798.      and remote processes.  Under the Psion OS, a process may use only
  799.      one NCP channel at a time.
  800.  
  801. Application Layer
  802.      Applications built on top of the NCP data stream service.  This
  803.      includes the remote file system and remote file server.  There is
  804.      also a supervisory application called LINK which controls the
  805.      server setup.
  806.  
  807. A more detailed description of NCP usage from the Psion side can be
  808. found in the `Psion SIBO SDK Manual, I/O Devices Reference'.
  809.  
  810. On the Amiga side, the serial layer is provided through any standard
  811. EXEC serial device, normally this will be the internal port's
  812. serial.device.  The packet and NCP layers have been built into
  813. the amigancp.library.
  814.  
  815. Besides these basic layers, also the supervisory LINK application
  816. resides in the
  817.     amigancp.library.
  818.  
  819. All network services are accessible via function calls to the
  820. amigancp.library.  In order to use these functions, you have to
  821. open the amigancp.library first:
  822.  
  823.          #include <libraries/ncp.h>
  824.      
  825.          struct Library *NCPBase;
  826.          NCPBase = OpenLibrary( "amigancp.library", NCP_VERSION );
  827.          if( !NCPBase )
  828.              fail_app();
  829.  
  830. If you use SAS/C 6.50 or above, you may want to use the link library
  831. ncp.lib provided in the development toolkit.  It contains a
  832. constructor/destructor pair that automatically opens/closes the
  833. amigancp.library upon startup/termination of your application.
  834.  
  835. If you are not using C, you'll have to build your own language specific
  836. glue definitions.  A function description file
  837. (Developer/FD/ncp_lib.fd) has been included.  The AmigaNCP
  838. programming interface doesn't use any fancy data structures, so you
  839. should have no problems with other programming languages.
  840.  
  841. The NCP network services are based on channels.  A channel is a
  842. connection between a local and a remote processes.  In the Psion EPOC
  843. environment, a channel is bound to a single process and bears the name
  844. of that process.  AmigaNCP allows you to specify arbitrary names for
  845. your channels, along with having multiple channels within a single
  846. application, if you wish to do so.
  847.  
  848. A channel may be opened in either active or passive mode.  An
  849. active channel attempts to connect to a remote process with a given name
  850. and refuses to open if the remote process doesn't exists or already is
  851. busy with some other connection.  A passive channel just sits around
  852. awaiting a connection from the remote site.  Passive channels are
  853. normally used for server applications awaiting connections from their
  854. clients, whereas active channels are used by clients to contact their
  855. server application.
  856.  
  857. I/O via NCP is done either synchronously or asynchronously.  The
  858. I/O interface of the amigancp.library is quite similar to the EXEC
  859. device I/O interface.  See the function descriptions of the NCP I/O
  860. functions for more details.
  861.  
  862. The Developer/Source/ drawer provides some examples to show the use
  863. of the
  864.     amigancp.library calls.
  865.  
  866. Function Reference
  867. ==================
  868.  
  869. Note that this function reference is also available in standard Amiga
  870. Autodoc format (Developer/Autodocs/ncp.doc).
  871.  
  872. The amigancp.library also contains a clone set of the exec.library
  873. memory pool functions which do work with AmigaOS 2.x systems. The the
  874. exec.library documentation for more information about these functions.
  875.  
  876. NCP_CloseChannel
  877. ----------------
  878.  
  879.         NAME
  880.          NCP_CloseChannel -- close an NCP channel
  881.      
  882.         SYNOPSIS
  883.          NCP_CloseChannel( channel )
  884.                             A0
  885.      
  886.         void NCP_CloseChannel( APTR );
  887.      
  888.         FUNCTION
  889.          Close a NCP channel previously opened by NCP_OpenChannel().
  890.          If this is an active link to the remote machine, it will be
  891.          closed.
  892.      
  893.         INPUTS
  894.          channel -- channel to close. May be NULL, in which case
  895.                     this functions does nothing.
  896.      
  897.         RESULT
  898.          None.
  899.      
  900.         EXAMPLE
  901.      
  902.         NOTES
  903.          An active NCP connection will be dropped about 10s
  904.          after the last channel has been closed.
  905.      
  906.         BUGS
  907.          None known.
  908.      
  909.         SEE ALSO
  910.          NCP_OpenChannel()
  911.  
  912. NCP_OpenChannel
  913. ---------------
  914.  
  915.         NAME
  916.          NCP_OpenChannel -- open an NCP channel to attempt to connect to
  917.                            the remote.
  918.      
  919.         SYNOPSIS
  920.          channel = NCP_OpenChannel( localname, remotename, flags )
  921.            D0                          A0          A1        D0
  922.      
  923.          APTR NCP_OpenChannel( STRPTR, STRPTR, ULONG );
  924.      
  925.         FUNCTION
  926.          Opens an NCP channel. If remotename is not NULL, attempts
  927.          to connect to the remote process and fails with a NULL
  928.          return if the connection could not be made. If remotename
  929.          is NULL, creates a passive channel silently awaiting remote
  930.          connection.
  931.      
  932.         INPUTS
  933.          localname -- name of local "process"
  934.          remotename -- either NULL for a passive channel or
  935.                        the remote process name which to connect
  936.                        to
  937.          flags -- currently unused, leave at 0
  938.      
  939.         RESULT
  940.          channel -- pointer to a channel object. NULL in case of
  941.                     an error, whereas additional error information
  942.                     can be found in IoErr()
  943.      
  944.         EXAMPLE
  945.          To connect to the remote file server:
  946.      
  947.             APTR channel;
  948.             channel = NCP_OpenChannel( "TestHost", "SYS$RFSV.*", 0 );
  949.      
  950.      
  951.         NOTES
  952.          Opening an active channel will result in an attempt to
  953.          create an NCP connection and fail upon any error (including
  954.          serial failure or inexistance of the remote process).
  955.          Creating an passive channel will not cause an NCP connection
  956.          attempt; this is done upon the first I/O request made to
  957.          channel.
  958.      
  959.         BUGS
  960.          None known.
  961.      
  962.         SEE ALSO
  963.          NCP_CloseChannel()
  964.  
  965. NCP_Read
  966. --------
  967.  
  968.         NAME
  969.          NCP_Read -- do a read request.
  970.      
  971.         SYNOPSIS
  972.          status = NCP_Read( channel, data, datasize )
  973.            D0                     A0
  974.      
  975.          LONG NCP_Read( APTR, APTR, ULONG );
  976.      
  977.         FUNCTION
  978.          This is basically identical to calling NCP_BeginRead()
  979.          followed by NCP_WaitRead().
  980.      
  981.         INPUTS
  982.          channel -- a NCP channel created by NCP_OpenChannel()
  983.          data -- receive buffer
  984.          datasize -- receive buffer size
  985.      
  986.         RESULT
  987.          status -- number of bytes read or a negative error
  988.                    number.
  989.      
  990.         EXAMPLE
  991.      
  992.         NOTES
  993.      
  994.         BUGS
  995.      
  996.         SEE ALSO
  997.          NCP_WaitRead(), NCP_BeginRead(), NCP_AbortRead(), NCP_CheckRead()
  998.  
  999. NCP_BeginRead
  1000. -------------
  1001.  
  1002.         NAME
  1003.          NCP_BeginRead -- start a read request on the NCP channel.
  1004.      
  1005.         SYNOPSIS
  1006.          error = NCP_BeginRead( channel, data, datasize )
  1007.            D0                     A0      A1       D0
  1008.      
  1009.          LONG NCP_BeginRead( APTR, APTR, ULON G);
  1010.      
  1011.         FUNCTION
  1012.          Queues a read operation on the current NCP channel.
  1013.      
  1014.         INPUTS
  1015.          channel -- a NCP channel created by NCP_OpenChannel()
  1016.          data -- receive buffer
  1017.          datasize -- receive buffer size
  1018.      
  1019.         RESULT
  1020.          error -- either 0 if the read was queued successfully
  1021.                   or a negative error number
  1022.      
  1023.         EXAMPLE
  1024.      
  1025.         NOTES
  1026.          Only one read request may be queued at a time on a single
  1027.          channel. This function fails with NCPE_INUSE if there is
  1028.          already a read request outstanding.
  1029.      
  1030.         BUGS
  1031.          None known.
  1032.      
  1033.         SEE ALSO
  1034.          NCP_Read(), NCP_WaitRead(), NCP_AbortRead(), NCP_CheckRead()
  1035.  
  1036. NCP_AbortRead
  1037. -------------
  1038.  
  1039.         NAME
  1040.          NCP_AbortRead -- abort read currently in progress
  1041.      
  1042.         SYNOPSIS
  1043.          NCP_AbortRead( channel )
  1044.                           A0
  1045.      
  1046.          void NCP_AbortRead( APTR )
  1047.      
  1048.         FUNCTION
  1049.          Aborts the current read request on the given NCP channel.
  1050.          Does nothing if no read is pending.
  1051.      
  1052.         INPUTS
  1053.          channel -- a NCP channel created by NCP_OpenChannel()
  1054.      
  1055.         RESULT
  1056.          None.
  1057.      
  1058.         EXAMPLE
  1059.      
  1060.         NOTES
  1061.          Never forget to finish a read request using NCP_WaitRead(),
  1062.          or you'll end up in OS hell.
  1063.      
  1064.         BUGS
  1065.          None known.
  1066.      
  1067.         SEE ALSO
  1068.          NCP_Read(), NCP_WaitRead(), NCP_CheckRead(), NCP_BeginRead()
  1069.  
  1070. NCP_CheckRead
  1071. -------------
  1072.  
  1073.         NAME
  1074.          NCP_CheckRead -- check if a read request is still pending
  1075.      
  1076.         SYNOPSIS
  1077.          status = NCP_CheckRead( channel )
  1078.            D0                       A0
  1079.      
  1080.          LONG NCP_CheckRead( APTR )
  1081.      
  1082.         FUNCTION
  1083.          Check if a read request is still pending on the given NCP
  1084.          channel.
  1085.      
  1086.         INPUTS
  1087.          channel -- a NCP channel created by NCP_OpenChannel()
  1088.      
  1089.         RESULT
  1090.          status -- FALSE if a read is currently pending,
  1091.                    TRUE if no request is pending or the current
  1092.                    request has completed.
  1093.      
  1094.         EXAMPLE
  1095.      
  1096.         NOTES
  1097.          Never forget to finish a read request using NCP_WaitRead(),
  1098.          or you'll end up in OS hell.
  1099.      
  1100.         BUGS
  1101.          None known.
  1102.      
  1103.         SEE ALSO
  1104.          NCP_Read(), NCP_WaitRead(), NCP_AbortRead(), NCP_BeginRead()
  1105.  
  1106. NCP_WaitRead
  1107. ------------
  1108.  
  1109.         NAME
  1110.          NCP_WaitRead -- complete a read request on the NCP channel.
  1111.      
  1112.         SYNOPSIS
  1113.          result = NCP_WaitRead( channel )
  1114.            D0                     A0
  1115.      
  1116.          LONG NCP_WaitRead( APTR );
  1117.      
  1118.         FUNCTION
  1119.          Waits for the current read request to finish and
  1120.          returns the result.
  1121.      
  1122.         INPUTS
  1123.          channel -- a NCP channel created by NCP_OpenChannel()
  1124.      
  1125.         RESULT
  1126.          status -- number of bytes read or a negative error
  1127.                    number.
  1128.      
  1129.         EXAMPLE
  1130.      
  1131.         NOTES
  1132.          Every read request startet with NCP_BeginRead() absolutely
  1133.          must be followed by a NCP_WaitRead(), even if it already
  1134.          finished or was aborted via NCP_AbortRead().
  1135.      
  1136.         BUGS
  1137.          Calling this function without an queued read request
  1138.          will hang up your process.
  1139.      
  1140.         SEE ALSO
  1141.          NCP_Read(), NCP_BeginRead(), NCP_AbortRead(), NCP_CheckRead()
  1142.  
  1143. NCP_ReadSig
  1144. -----------
  1145.  
  1146.         NAME
  1147.          NCP_ReadSig -- return signal mask of channel read port.
  1148.      
  1149.         SYNOPSIS
  1150.          sigmask = NCP_ReadSig( channel )
  1151.            D0                     A0
  1152.      
  1153.          ULONG NCP_ReadSig( APTR );
  1154.      
  1155.         FUNCTION
  1156.          This function returns the signal mask of the read port
  1157.          of the given NCP channel. This signal is set if a read
  1158.          request completes.
  1159.      
  1160.         INPUTS
  1161.          channel -- a NCP channel created by NCP_OpenChannel()
  1162.      
  1163.         RESULT
  1164.          sigmask -- signal mask of read port.
  1165.      
  1166.         EXAMPLE
  1167.      
  1168.         NOTES
  1169.          Note that this function returns a signal mask, not a signal bit number.
  1170.      
  1171.         BUGS
  1172.      
  1173.         SEE ALSO
  1174.          NCP_BeginRead()
  1175.  
  1176. NCP_Write
  1177. ---------
  1178.  
  1179.         NAME
  1180.          NCP_Write -- do a write request.
  1181.      
  1182.         SYNOPSIS
  1183.          status = NCP_Write( channel, data, datasize )
  1184.            D0                   A0     A1      D0
  1185.      
  1186.          LONG NCP_Write( APTR, APTR, ULONG );
  1187.      
  1188.         FUNCTION
  1189.          This is basically identical to calling NCP_BeginWrite()
  1190.          followed by NCP_WaitWrite().
  1191.      
  1192.         INPUTS
  1193.          channel -- a NCP channel created by NCP_OpenChannel()
  1194.          data -- receive buffer
  1195.          datasize -- receive buffer size
  1196.      
  1197.         RESULT
  1198.          status -- number of bytes written or a negative error
  1199.                    number.
  1200.      
  1201.         EXAMPLE
  1202.      
  1203.         NOTES
  1204.      
  1205.         BUGS
  1206.      
  1207.         SEE ALSO
  1208.          NCP_WaitWrite(), NCP_BeginWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1209.  
  1210. NCP_BeginWrite
  1211. --------------
  1212.  
  1213.         NAME
  1214.          NCP_BeginWrite -- start a write request on the NCP channel.
  1215.      
  1216.         SYNOPSIS
  1217.          error = NCP_BeginWrite( channel, data, datasize )
  1218.            D0                     A0      A1       D0
  1219.      
  1220.          LONG NCP_BeginWrite( APTR, APTR, ULON G);
  1221.      
  1222.         FUNCTION
  1223.          Queues a write operation on the current NCP channel.
  1224.      
  1225.         INPUTS
  1226.          channel -- a NCP channel created by NCP_OpenChannel()
  1227.          data -- data buffer
  1228.          datasize -- data buffer size
  1229.      
  1230.         RESULT
  1231.          error -- either 0 if the write was queued successfully
  1232.                   or a negative error number
  1233.      
  1234.         EXAMPLE
  1235.      
  1236.         NOTES
  1237.          Only one write request may be queued at a time on a single
  1238.          channel. This function fails with NCPE_INUSE if there is
  1239.          already a write request outstanding.
  1240.      
  1241.         BUGS
  1242.          None known.
  1243.      
  1244.         SEE ALSO
  1245.          NCP_Write(), NCP_WaitWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1246.  
  1247. NCP_AbortWrite
  1248. --------------
  1249.  
  1250.         NAME
  1251.          NCP_AbortWrite -- abort write currently in progress
  1252.      
  1253.         SYNOPSIS
  1254.          NCP_AbortWrite( channel )
  1255.                           A0
  1256.      
  1257.          void NCP_AbortWrite( APTR )
  1258.      
  1259.         FUNCTION
  1260.          Aborts the current write request on the given NCP channel.
  1261.          Does nothing if no write is pending.
  1262.      
  1263.         INPUTS
  1264.          channel -- a NCP channel created by NCP_OpenChannel()
  1265.      
  1266.         RESULT
  1267.          None.
  1268.      
  1269.         EXAMPLE
  1270.      
  1271.         NOTES
  1272.          Never forget to finish a write request using NCP_WaitWrite(),
  1273.          or you'll end up in OS hell.
  1274.      
  1275.         BUGS
  1276.          None known.
  1277.      
  1278.         SEE ALSO
  1279.          NCP_Write(), NCP_WaitWrite(), NCP_CheckWrite(), NCP_BeginWrite()
  1280.  
  1281. NCP_CheckWrite
  1282. --------------
  1283.  
  1284.         NAME
  1285.          NCP_CheckWrite -- check if a write request is still pending
  1286.      
  1287.         SYNOPSIS
  1288.          status = NCP_CheckWrite( channel )
  1289.            D0                       A0
  1290.      
  1291.          LONG NCP_CheckWrite( APTR )
  1292.      
  1293.         FUNCTION
  1294.          Check if a write request is still pending on the given NCP
  1295.          channel.
  1296.      
  1297.         INPUTS
  1298.          channel -- a NCP channel created by NCP_OpenChannel()
  1299.      
  1300.         RESULT
  1301.          status -- FALSE if a write is currently pending,
  1302.                    TRUE if no request is pending or the current
  1303.                    request has completed.
  1304.      
  1305.         EXAMPLE
  1306.      
  1307.         NOTES
  1308.          Never forget to finish a write request using NCP_WaitWrite(),
  1309.          or you'll end up in OS hell.
  1310.      
  1311.         BUGS
  1312.          None known.
  1313.      
  1314.         SEE ALSO
  1315.          NCP_Write(), NCP_WaitWrite(), NCP_AbortWrite(), NCP_BeginWrite()
  1316.  
  1317. NCP_WaitWrite
  1318. -------------
  1319.  
  1320.         NAME
  1321.          NCP_WaitWrite -- complete a write request on the NCP channel.
  1322.      
  1323.         SYNOPSIS
  1324.          result = NCP_WaitWrite( channel )
  1325.            D0                     A0
  1326.      
  1327.          LONG NCP_WaitWrite( APTR );
  1328.      
  1329.         FUNCTION
  1330.          Waits for the current write request to finish and
  1331.          returns the result.
  1332.      
  1333.         INPUTS
  1334.          channel -- a NCP channel created by NCP_OpenChannel()
  1335.      
  1336.         RESULT
  1337.          status -- number of bytes written or a negative error
  1338.                    number.
  1339.      
  1340.         EXAMPLE
  1341.      
  1342.         NOTES
  1343.          Every write request startet with NCP_BeginWrite() absolutely
  1344.          must be followed by a NCP_WaitWrite(), even if it already
  1345.          finished or was aborted via NCP_AbortWrite().
  1346.      
  1347.         BUGS
  1348.          Calling this function without an queued write request
  1349.          will hang up your process.
  1350.      
  1351.         SEE ALSO
  1352.          NCP_Write(), NCP_BeginWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1353.  
  1354. NCP_WriteSig
  1355. ------------
  1356.  
  1357.         NAME
  1358.          NCP_WriteSig -- return signal mask of channel write port.
  1359.      
  1360.         SYNOPSIS
  1361.          sigmask = NCP_WriteSig( channel )
  1362.            D0                     A0
  1363.      
  1364.          ULONG NCP_WriteSig( APTR );
  1365.      
  1366.         FUNCTION
  1367.          This function returns the signal mask of the write port
  1368.          of the given NCP channel. This signal is set if a write
  1369.          request completes.
  1370.      
  1371.         INPUTS
  1372.          channel -- a NCP channel created by NCP_OpenChannel()
  1373.      
  1374.         RESULT
  1375.          sigmask -- signal mask of write port.
  1376.      
  1377.         EXAMPLE
  1378.      
  1379.         NOTES
  1380.          Note that this function returns a signal mask, not a signal bit number.
  1381.      
  1382.         BUGS
  1383.      
  1384.         SEE ALSO
  1385.          NCP_BeginWrite()
  1386.  
  1387. NCP_Fault
  1388. ---------
  1389.  
  1390.         NAME
  1391.          NCP_Fault -- return localized NCP error string
  1392.      
  1393.         SYNOPSIS
  1394.          NCP_Fault( code, header, buffer, buffersize );
  1395.                     D0     A0      A1        D1
  1396.      
  1397.         void NCP_Fault( LONG, STRPTR, STRPTR, ULONG );
  1398.      
  1399.         FUNCTION
  1400.          Returns a localized text string associated with the
  1401.          error code.
  1402.      
  1403.         INPUTS
  1404.          code -- NCP error code
  1405.          header -- header to insert before string. May be NULL
  1406.          buffer -- buffer to write the error text to
  1407.          buffersize -- size of buffer
  1408.      
  1409.         RESULT
  1410.          None.
  1411.      
  1412.         EXAMPLE
  1413.      
  1414.         NOTES
  1415.      
  1416.         BUGS
  1417.          None known.
  1418.      
  1419.         SEE ALSO
  1420.          dos.library/Fault()
  1421.  
  1422. NCP_LinkRemoteRun
  1423. -----------------
  1424.  
  1425.         NAME
  1426.          NCP_LinkRemoteRun -- use the NCP link channel to run a program on
  1427.                               the remote machine.
  1428.      
  1429.         SYNOPSIS
  1430.          error = NCP_LinkRemoteRun( filename, cmdline, cmdlinelen )
  1431.          D0                            A0       A1        D0
  1432.      
  1433.         LONG NCP_LinkRemoteRun( STRPTR, APTR, ULONG );
  1434.      
  1435.         FUNCTION
  1436.          Use the LINK supervisor channel to have the remote link
  1437.          run a program. No NCP channel needs to be opened in order
  1438.          to perform this operation.
  1439.      
  1440.         INPUTS
  1441.          filename -- file name of the remote program to start
  1442.          cmdline -- pointer to command line array. Note that
  1443.                     EPOC command lines are *NOT* zero terminated.
  1444.          cmdlinelen -- length of command line in bytes. May be
  1445.                        zero, in which case no command line
  1446.                        is transfered.
  1447.      
  1448.         RESULT
  1449.          error -- either an AmigaNCP specific error code or the
  1450.                   result code from the remote link.
  1451.      
  1452.         EXAMPLE
  1453.          Have WORD.APP read the Amiga startup sequence:
  1454.      
  1455.             UBYTE cmdline[] = {
  1456.              "OANCPTest\000 V TES\000REM::SYS:\S\STARTUP-SEQUENCE\000"
  1457.             };
  1458.             error = NCP_LinkRemoteRun( "WORD.APP", cmdline, sizeof( cmdline ) );
  1459.      
  1460.         NOTES
  1461.          See the Psion SDK for more information about using commandlines and
  1462.          the LINK process launch feature.
  1463.      
  1464.         BUGS
  1465.          None known.
  1466.      
  1467.         SEE ALSO
  1468.  
  1469. NCP_clnl
  1470. --------
  1471.  
  1472.         NAME
  1473.          NCP_clnl -- clear CR/LF at end of line.
  1474.      
  1475.         SYNOPSIS
  1476.          NCP_clnl( string )
  1477.                    A0
  1478.      
  1479.          void NCP_clnl( STRPTR );
  1480.      
  1481.         FUNCTION
  1482.          Clears any CR or LF characters at the end of the string.
  1483.      
  1484.         INPUTS
  1485.          string -- pointer to string (contents will be modified)
  1486.      
  1487.         RESULT
  1488.          None.
  1489.      
  1490.         EXAMPLE
  1491.      
  1492.         NOTES
  1493.      
  1494.         BUGS
  1495.          None known.
  1496.      
  1497.         SEE ALSO
  1498.  
  1499. NCP_ibm2iso
  1500. -----------
  1501.  
  1502.         NAME
  1503.          NCP_ibm2iso -- convert IBM to ISO charachter
  1504.      
  1505.         SYNOPSIS
  1506.          isochar = NCP_ibm2iso( ibmchar )
  1507.            D0                    D0 0:7
  1508.      
  1509.          UBYTE NCP_ibm2iso( UBYTE );
  1510.      
  1511.         FUNCTION
  1512.          Converts a character from the IBM to the ISO charset.
  1513.      
  1514.         INPUTS
  1515.          ibmchar -- character of the IBM codeset
  1516.      
  1517.         RESULT
  1518.          isochar -- equivalent character in the ISO codeset
  1519.      
  1520.         EXAMPLE
  1521.      
  1522.         NOTES
  1523.      
  1524.         BUGS
  1525.          None known.
  1526.      
  1527.         SEE ALSO
  1528.  
  1529. NCP_tab_ibm2iso
  1530. ---------------
  1531.  
  1532.         NAME
  1533.          NCP_tab_ibm2iso -- returns pointer to internal ibm2iso tab
  1534.      
  1535.         SYNOPSIS
  1536.          tab = NCP_tab_ibm2iso()
  1537.          D0/A0
  1538.      
  1539.          UBYTE *NCP_tab_ibm2iso( void );
  1540.      
  1541.         FUNCTION
  1542.          Returns a pointer to the internal ibm2iso conversion table.
  1543.          This allows you to do more efficient conversion.
  1544.      
  1545.         INPUTS
  1546.          None.
  1547.      
  1548.         RESULT
  1549.          tab -- pointer to 256 byte conversion table.
  1550.      
  1551.         EXAMPLE
  1552.      
  1553.         NOTES
  1554.          The pointer is returned both in D0 and A0.
  1555.      
  1556.         BUGS
  1557.          None known.
  1558.      
  1559.         SEE ALSO
  1560.  
  1561. NCP_tab_iso2ibm
  1562. ---------------
  1563.  
  1564.         NAME
  1565.          NCP_tab_iso2ibm -- returns pointer to internal iso2ibm tab
  1566.      
  1567.         SYNOPSIS
  1568.          tab = NCP_tab_iso2ibm()
  1569.          D0/A0
  1570.      
  1571.          UBYTE *NCP_tab_iso2ibm( void );
  1572.      
  1573.         FUNCTION
  1574.          Returns a pointer to the internal ISO2IBM conversion table.
  1575.          This allows you to do more efficient conversion.
  1576.      
  1577.         INPUTS
  1578.          None.
  1579.      
  1580.         RESULT
  1581.          tab -- pointer to 256 byte conversion table.
  1582.      
  1583.         EXAMPLE
  1584.      
  1585.         NOTES
  1586.          The pointer is returned both in D0 and A0.
  1587.      
  1588.         BUGS
  1589.          None known.
  1590.      
  1591.         SEE ALSO
  1592.  
  1593. NCP_iso2ibm
  1594. -----------
  1595.  
  1596.         NAME
  1597.          NCP_iso2ibm -- convert IBM to ISO charachter
  1598.      
  1599.         SYNOPSIS
  1600.          ibmchar = NCP_iso2ibm( isochar )
  1601.            D0                    D0 0:7
  1602.      
  1603.          UBYTE NCP_iso2ibm( UBYTE );
  1604.      
  1605.         FUNCTION
  1606.          Converts a character from the ISO to the IBM charset.
  1607.      
  1608.         INPUTS
  1609.          isochar -- character of the ISO codeset
  1610.      
  1611.         RESULT
  1612.          ibmchar -- equivalent character in the IBM codeset
  1613.      
  1614.         EXAMPLE
  1615.      
  1616.         NOTES
  1617.      
  1618.         BUGS
  1619.          None known.
  1620.      
  1621.         SEE ALSO
  1622.  
  1623. NCP_IWORD
  1624. ---------
  1625.  
  1626.         NAME
  1627.          NCP_IWORD -- swap bytes in word
  1628.      
  1629.         SYNOPSIS
  1630.          sword = NCP_IWORD( word )
  1631.            D0                D0
  1632.      
  1633.          UWORD NCP_IWORD( UWORD );
  1634.      
  1635.         FUNCTION
  1636.          Swaps the byte order within the word.
  1637.      
  1638.         INPUTS
  1639.          word -- a 16 bit data word.
  1640.      
  1641.         RESULT
  1642.          sword -- the same word with the byte order swapped.
  1643.      
  1644.         EXAMPLE
  1645.      
  1646.         NOTES
  1647.      
  1648.         BUGS
  1649.          None known.
  1650.      
  1651.         SEE ALSO
  1652.  
  1653. NCP_IWORDP
  1654. ----------
  1655.  
  1656.         NAME
  1657.          NCP_IWORDP -- swap bytes in word (pointer version)
  1658.      
  1659.         SYNOPSIS
  1660.          sword = NCP_IWORDP( wordp1, wordp2 )
  1661.            D0                  A0      A1
  1662.      
  1663.          UWORD NCP_IWORDP( UWORD *, UWORD * );
  1664.      
  1665.         FUNCTION
  1666.          Swaps the byte order from the word pointed to by wordp1
  1667.          and places the result in the word pointed to by wordp2.
  1668.      
  1669.         INPUTS
  1670.          wordp1 -- pointer to source word
  1671.          wordp2 -- pointer to destination word
  1672.      
  1673.         RESULT
  1674.          sword -- the same word with the byte order swapped.
  1675.      
  1676.         EXAMPLE
  1677.      
  1678.         NOTES
  1679.          The words don't need to be word aligned.
  1680.      
  1681.         BUGS
  1682.          The 68020++ version of amigancp.library requires the hardware
  1683.          to be able to do misaligned word accesses. Some early
  1684.          accelerator boards may have problems doing this.
  1685.      
  1686.         SEE ALSO
  1687.  
  1688. NCP_IWORDPI
  1689. -----------
  1690.  
  1691.         NAME
  1692.          NCP_IWORDPI -- swap bytes in word (in-place pointer version)
  1693.      
  1694.         SYNOPSIS
  1695.          sword = NCP_IWORDPI( wordp1 )
  1696.            D0                   A0
  1697.      
  1698.          UWORD NCP_IWORDP( UWORD * )
  1699.      
  1700.         FUNCTION
  1701.          Swaps the byte order within the word pointed to by wordp.
  1702.      
  1703.         INPUTS
  1704.          wordp -- pointer to word to swap
  1705.      
  1706.         RESULT
  1707.          sword -- the same word with the byte order swapped.
  1708.      
  1709.         EXAMPLE
  1710.      
  1711.         NOTES
  1712.          The word doesn't need to be word aligned.
  1713.      
  1714.         BUGS
  1715.          The 68020++ version of amigancp.library requires the hardware
  1716.          to be able to do misaligned word accesses. Some early
  1717.          accelerator boards may have problems doing this.
  1718.      
  1719.         SEE ALSO
  1720.  
  1721. NCP_ILONG
  1722. ---------
  1723.  
  1724.         NAME
  1725.          NCP_ILONG -- swap bytes in longword
  1726.      
  1727.         SYNOPSIS
  1728.          slongword = NCP_ILONG( longword )
  1729.            D0                     D0
  1730.      
  1731.          ULONG NCP_ILONG( ULONG );
  1732.      
  1733.         FUNCTION
  1734.          Swaps the byte order within the longword.
  1735.      
  1736.         INPUTS
  1737.          longword -- a 32 bit data word.
  1738.      
  1739.         RESULT
  1740.          slongword -- the same word with the byte order swapped.
  1741.      
  1742.         EXAMPLE
  1743.      
  1744.         NOTES
  1745.      
  1746.         BUGS
  1747.          None known.
  1748.      
  1749.         SEE ALSO
  1750.  
  1751. NCP_ILONGP
  1752. ----------
  1753.  
  1754.         NAME
  1755.          NCP_ILONGP -- swap bytes in longword (pointer version)
  1756.      
  1757.         SYNOPSIS
  1758.          sword = NCP_ILONGP( longwordp1, longwordp2 )
  1759.            D0                    A0          A1
  1760.      
  1761.          ULONG NCP_ILONGP( ULONG *, ULONG * );
  1762.      
  1763.         FUNCTION
  1764.          Swaps the byte order from the longword pointed to by longwordp1
  1765.          and places the result in the longword pointed to by longwordp2.
  1766.      
  1767.         INPUTS
  1768.          longwordp1 -- pointer to source longword
  1769.          longwordp2 -- pointer to destination longword
  1770.      
  1771.         RESULT
  1772.          sword -- the same word with the byte order swapped.
  1773.      
  1774.         EXAMPLE
  1775.      
  1776.         NOTES
  1777.          The longwords don't need to be word aligned.
  1778.      
  1779.         BUGS
  1780.          The 68020++ version of amigancp.library requires the hardware
  1781.          to be able to do misaligned word accesses. Some early
  1782.          accelerator boards may have problems doing this.
  1783.      
  1784.         SEE ALSO
  1785.  
  1786. NCP_ILONGPI
  1787. -----------
  1788.  
  1789.         NAME
  1790.          NCP_ILONGPI -- swap bytes in longword (in-place pointer version)
  1791.      
  1792.         SYNOPSIS
  1793.          sword = NCP_ILONGPI( longwordp )
  1794.            D0                    A0
  1795.      
  1796.          ULONG NCP_ILONGP( ULONG * )
  1797.      
  1798.         FUNCTION
  1799.          Swaps the byte order within the longword pointed to by longwordp.
  1800.      
  1801.         INPUTS
  1802.          longwordp -- pointer to longword to swap
  1803.      
  1804.         RESULT
  1805.          sword -- the same word with the byte order swapped.
  1806.      
  1807.         EXAMPLE
  1808.      
  1809.         NOTES
  1810.          The longword doesn't need to be word aligned.
  1811.      
  1812.         BUGS
  1813.          The 68020++ version of amigancp.library requires the hardware
  1814.          to be able to do misaligned word accesses. Some early
  1815.          accelerator boards may have problems doing this.
  1816.      
  1817.         SEE ALSO
  1818.  
  1819. Error codes from NCP functions
  1820. ==============================
  1821.  
  1822. Several amigancp.library functions may return negative error
  1823. numbers.  Note that besides the errors internal to
  1824. amigancp.library, standard EPOC OS errors may be returned by some
  1825. functions.
  1826.  
  1827. NCPE_INUSE (-1)
  1828.      There is already a read/write request pending on the given channel.
  1829.  
  1830. NCPE_ABORTED (-2)
  1831.      The read/write request has been aborted by NCP_AbortXXX()
  1832.  
  1833. NCPE_OFFLINE (-3)
  1834.      There is no NCP connection.  This may denote that the remote NCP
  1835.      closed the connection.
  1836.  
  1837. NCPE_INACTIVE (-4)
  1838.      The channel is currently inactive.  Most likely it has been closed
  1839.      by the remote process, or the NCP connection is currently dropped
  1840.      due to serial link failure.
  1841.  
  1842. NCPE_NOTFOUND (-5)
  1843.      You attempted to open an active channel and the remote process
  1844.      didn't exist.
  1845.  
  1846. NCPE_RECONNECTED (-6)
  1847.      This is not really an error.  Queued read requests will be
  1848.      terminated with this error value if the NCP connection has been
  1849.      succesfully reconnected.
  1850.  
  1851. NCPE_NEWUSER (-7)
  1852.      This is not really an error.  It may come up if the remote client
  1853.      of a passive channel changed.
  1854.  
  1855. Index
  1856. *****
  1857.  
  1858.  
  1859.  
  1860.  NCP.config                             Using AmigaNCP
  1861.  AmigaNCP File Server                   File Server
  1862.  AmigaNCP File System                   File System
  1863.  amigancp.library calls                 API
  1864.  amigancp.library functions             API
  1865.  API                                    API
  1866.  error codes                            Errors
  1867.  File Server options                    File Server
  1868.  File System Options                    File System
  1869.  function calls                         API
  1870.  Installation                           Using AmigaNCP
  1871.  Installing AmigaNCP                    Using AmigaNCP
  1872.  Introduction                           Introduction
  1873.  Monitor                                AmigaNCP-Monitor
  1874.  NCP errors                             Errors
  1875.  NCP-Monitor                            AmigaNCP-Monitor
  1876.  NCP_AbortRead                          NCP_AbortRead
  1877.  NCP_AbortWrite                         NCP_AbortWrite
  1878.  NCP_BeginRead                          NCP_BeginRead
  1879.  NCP_BeginWrite                         NCP_BeginWrite
  1880.  NCP_CheckRead                          NCP_CheckRead
  1881.  NCP_CheckWrite                         NCP_CheckWrite
  1882.  NCP_clnl                               NCP_clnl
  1883.  NCP_CloseChannel                       NCP_CloseChannel
  1884.  NCP_Fault                              NCP_Fault
  1885.  NCP_ibm2iso                            NCP_ibm2iso
  1886.  NCP_ILONG                              NCP_ILONG
  1887.  NCP_ILONGP                             NCP_ILONGP
  1888.  NCP_ILONGPI                            NCP_ILONGPI
  1889.  NCP_iso2ibm                            NCP_iso2ibm
  1890.  NCP_IWORD                              NCP_IWORD
  1891.  NCP_IWORDP                             NCP_IWORDP
  1892.  NCP_IWORDPI                            NCP_IWORDPI
  1893.  NCP_LinkRemoteRun                      NCP_LinkRemoteRun
  1894.  NCP_OpenChannel                        NCP_OpenChannel
  1895.  NCP_Read                               NCP_Read
  1896.  NCP_ReadSig                            NCP_ReadSig
  1897.  NCP_tab_ibm2iso                        NCP_tab_ibm2iso
  1898.  NCP_tab_iso2ibm                        NCP_tab_iso2ibm
  1899.  NCP_WaitRead                           NCP_WaitRead
  1900.  NCP_WaitWrite                          NCP_WaitWrite
  1901.  NCP_Write                              NCP_Write
  1902.  NCP_WriteSig                           NCP_WriteSig
  1903.  Network Monitor                        AmigaNCP-Monitor
  1904.  Options, File Server                   File Server
  1905.  Options, File System                   File System
  1906.  Other Tools                            Other Tools
  1907.  Parts                                  Introduction
  1908.  Remote File Server                     File Server
  1909.  Remote File System                     File System
  1910.  S3PrintServer                          S3PrintServer
  1911.  S3Run                                  S3Run
  1912.  serial configuration                   Using AmigaNCP
  1913.  serial.device, configuration of        Using AmigaNCP
  1914.  
  1915.